package com.ruoyi.product.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.product.domain.vo.couponVo;
import com.ruoyi.product.domain.vo.skuActivityVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 商品分类对象 product_category
 *
 * @author liuhizhong
 * @date 2025-07-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
public class ProductCategoryDto extends ProductSku {
    private static final long serialVersionUID = 1L;

    /**
     * 分类名称（如“餐桌”、“沙发”）
     */
    @Excel(name = "分类名称", readConverterExp = "如=“餐桌”、“沙发”")
    private String name;

    /**
     * 层级（1-一级，2-二级）
     */
    @Excel(name = "层级", readConverterExp = "1=-一级，2-二级")
    private Long level;

    /**
     * spuid
     */
    @Excel(name = "spuid")
    private Long spuId;

    /**
     * spu_name
     */
    @Excel(name = "spu_name")
    private String spuName;

    /**
     * SPU 标题
     */
    private String spuTitle;

    /**
     * SPU 描述
     */
    private String spuDescription;
    /**
     * 图片路径
     */
    @Excel(name = "图片路径")
    @JsonIgnore
    private String url;
    /**
     * sku名
     */
    @Excel(name = "sku名")
    private String skuName;

    /**
     * 商品描述
     */
    @Excel(name = "商品描述")
    private String description;

    /**
     * 多个图片路径
     */
    private List<String> urls;

    /**
     * 规格组名
     */
    @Excel(name = "规格组名")
    private List<String> specNameGroup;

    /**
     * 规格组值
     */
    @Excel(name = "规格组值")
    private List<String> specValueGroup;

    /**
     * 临时字段：从数据库获取的原始规格组名字符串
     */
    @JsonIgnore
    private String specNameGroupRaw;

    /**
     * 临时字段：从数据库获取的原始规格组值字符串
     */
    @JsonIgnore
    private String specValueGroupRaw;

    /**
     * 规格类型（来自 product_spec.type）
     */
    private Integer specType;

    /**
     * 规格名称（来自 product_spec.name）
     */
    private String specName;

    private List<couponVo> couponList;
    private List<skuActivityVo> activityList;

    // 临时字段，用于接收数据库查询结果，不参与最终JSON序列化
    @JsonIgnore
    private Long couponId;
    @JsonIgnore
    private String couponCode;
    @JsonIgnore
    private String couponName;
    @JsonIgnore
    private Long couponType;
    @JsonIgnore
    private BigDecimal couponValue;
    @JsonIgnore
    private Long couponStock;
    @JsonIgnore
    private BigDecimal minAmount;
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date couponStartTime;
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date couponEndTime;
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date getTime;
    @JsonIgnore
    private Long couponStatus;
    @JsonIgnore
    private String couponRemark;

    // 临时字段，用于接收数据库查询结果，不参与最终JSON序列化
    @JsonIgnore
    private Long activityId;
    @JsonIgnore
    private String activityName;
    @JsonIgnore
    private Integer activityType;
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date activityStartTime;
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date activityEndTime;
    @JsonIgnore
    private String activityDesc;
    @JsonIgnore
    private String posterUrl;
    @JsonIgnore
    private Integer activityStatus;

}
